package com.netease.nim.uikit.xpopup.popuview

import android.content.Context
import android.view.View
import android.widget.TextView
import com.lxj.xpopup.core.BottomPopupView
import www.wen.com.common.R
import www.wen.com.common.lib.extension.setOnClickListenerAgency
import www.wen.com.common.lib.helper.ResultUiCallBack


/**
 * @author WEN
 * @Description: 底部分享的弹窗
 * @date 2021/8/19 14:41
 */
class BottomSharePopupView(
    context: Context,
    private val address: String,
    private val resultCallBack: ResultUiCallBack<String>?,
) : BottomPopupView(context), View.OnClickListener {

    private lateinit var shareWx: View

    private lateinit var shareWxFriend: View

    private lateinit var tvAddress: TextView

    override fun getImplLayoutId(): Int = R.layout.popupview_invite

    override fun onCreate() {
        super.onCreate()
        shareWx = findViewById(R.id.llShareWeChat)
        shareWxFriend = findViewById(R.id.llShareToFriends)
        tvAddress = findViewById(R.id.tvAddress)
        tvAddress.text = address
        setOnClickListenerAgency(this, shareWx, shareWxFriend, tvAddress)
    }

    override fun onClick(v: View) {
        resultCallBack?.invoke(v,address,this)
    }

}